<!DOCTYPE >
<html lang="zh-cn">
<head>
		<title>后台管理-功能</title>
    <% include ../partials/head %>
    <script src="/js/admin/article.js"></script>

</head>
<body>
	<header>
    <% include ../partials/header %>
  </header>
  <div class="ch-container">
    <div class="row">
      <% include ../partials/sidebar %>
      <!-- 页面内容 -->
      <div id="content" class="col-lg-10 col-sm-10">
        <div class="row">
          <ul class="breadcrumb">
            <li>
                <a href="/admin/article">文章管理</a>
            </li>
            <li>
                <a href="">新增</a>
            </li>
          </ul>
        </div>

        <% if (typeof errMsg != "undefined") { %>
        <div class="alert alert-danger">
            <button type="button" class="close" data-dismiss="alert">&times;</button>
            <strong><%= errMsg %></strong>
        </div>
        <% } %>

        <div class="row">
          <div class="box col-md-12">
            <div class="box-inner">
              <div class="box-header well" data-original-title="">
                <h2><i class="glyphicon glyphicon-edit"></i> 新增文章 </h2>
              </div>

              <div class="box-content">

                <form role="form" method="post" enctype="multipart/form-data" action="/admin/article/add">
                  <div class="form-group">
                      <label>标题:</label>
                      <input type="text" name="title" class="form-control" id="titleText" placeholder="输入标题">
                  </div>
                  <div class="form-group">
                      <label>标题图片:</label>
                      <input type="file" name="articleImg" id="articleImgFile">
                  </div>

                  <div class="form-group">
                      <label >文章介绍:</label>
                      <textarea rows="5" name="intro" class="form-control" id="introText" placeholder="输入文章介绍"></textarea>
                  </div>

                  <div class="form-group">
                    <label >所属专题:</label>
                    <select id="topicSelector" name="topicId" >
                        <option value="">不属于任何专题</option>
                        <% if (typeof topics != "undefined") { %>
                          <% topics.forEach(function(topic) { %>
                          <option value="<%= topic.id %>">  <%= topic.get("title") %></option>
                          <% }) %>
                        <% } %>
                    </select>
                  </div>

                  <button class="btn btn-success" id="saveArticle" type="submit"><i class="glyphicon glyphicon-shopping-cart"></i>保存</button>
                </form>
              </div>

            </div>
          </div>
        </div>
      </div>

    </div>

    <% include ../partials/footer %>
  </div>
  <% include ../partials/external %>
</body>
</html>
